package com.powerdata.system.paimon;

import com.powerdata.core.paimon.bean.table.*;
import com.powerdata.system.domain.param.PaimonCatalogParam;
import com.powerdata.system.domain.param.PaimonTableParam;
import com.powerdata.system.domain.param.TableToDataParam;
import com.powerdata.system.domain.param.UpdateDataParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * @author deeprado
 * @version 1.0
 * @description
 * @date 2023/6/12 16:52
 */
public interface ITableService {
    List<String> tableList(PaimonCatalogParam paimonCatalogParam) throws Exception;

    TableMetricsBean getTableMetrics(PaimonCatalogParam paimonCatalogParam) throws Exception;

    String getSchemasOfTable(PaimonCatalogParam paimonCatalogParam) throws Exception;

    List<TableColumnsBean> getColumnsOfTable(PaimonCatalogParam paimonCatalogParam) throws Exception;

    List<TablePartitionKeysBean> getPartitionMessage(PaimonCatalogParam paimonCatalogParam) throws Exception;

    TableOptionBean getOptionsMessage(PaimonCatalogParam paimonCatalogParam) throws Exception;

    List<TableTransactionsBean> getTransactionsMessage(PaimonCatalogParam paimonCatalogParam) throws Exception;

    Map<String, Object> getTableData(PaimonCatalogParam paimonCatalogParam) throws Exception;

    Map<String, Object> getDataBySnapshotId(PaimonCatalogParam paimonCatalogParam) throws Exception;

    Map<String, Object> getDataByTime(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void setCurrentSnapshot(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void rollbackSnapshot(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void cherryPickSnapshot(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void addData(PaimonCatalogParam paimonCatalogParam) throws Exception;

    Map<String, Object> getAppendSnapshotTableData(PaimonCatalogParam paimonCatalogParam) throws Exception;

    Map<String, Object> getBetweenSnapshotTableData(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void deleteTable(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void renameTable(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void moveTable(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void createTable(PaimonTableParam paimonTableParam) throws Exception;

    void updateTable(PaimonTableParam paimonTableParam) throws Exception;

    PaimonTableParam queryTableInfo(PaimonTableParam paimonTableParam) throws Exception;

    void deleteData(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void importDataToTable(String id, String type, String hiveUrl, String warehouse, String databaseName,
                           String tableName, MultipartFile file) throws Exception;

    Map<String, Object> getMetadataFiles(PaimonCatalogParam paimonCatalogParam) throws Exception;

    String getMetadata(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void mergeSmallFile(PaimonCatalogParam paimonCatalogParam) throws Exception;

    Map<String, Object> tableList2(PaimonCatalogParam paimonCatalogParam) throws Exception;

    void tableDataToFile(TableToDataParam tableToDataParam) throws Exception;

    void updateData(UpdateDataParam updateDataParam) throws Exception;

    void fileToTableData(TableToDataParam tableToDataParam) throws Exception;

    void clearTableData(PaimonTableParam paimonTableParam) throws Exception;
}
